<?php

namespace IDock\Insurance\CHAC\Response;

use IDock\Http\Response;
use IDock\Printer\ProposalRecallPrinter;

class J2ProposalRecallResponse extends AllCHACResponse
{
    /**
     * @var ProposalRecallPrinter $printer
     */
    public $printer = ProposalRecallPrinter::class;

    public $urlDecode = true;

    public function printerInit(): Response
    {
        $header = $this->get('responseHead');

        if ($header['responseCode'] != '0000') {
            $this->setError($header['errorMessage'] ?? '');
            return $this;
        }

        $this->printer->isSuccess = 'success';

        return $this;
    }
}
